package com.knowif.backend.service;

import com.github.pagehelper.PageHelper;
import com.knowif.pojo.OfferInterviewComment;
import com.knowif.pojo.OfferInterviewCommentExample;
import com.knowif.service.OfferInterviewComment_service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：Xh
 * @date ：Created in 2019/6/5 0005 20:58
 */
@Service
public class OfferInterviewCommentService {

    @Autowired
    private OfferInterviewComment_service offerInterviewComment_service;

    /**
     * 条件查询offerInterviewComment
     * @param offerInterviewCommentExample
     * @return
     */
    public List<OfferInterviewComment> selectOfferInterviewComment(OfferInterviewCommentExample offerInterviewCommentExample){
        return offerInterviewComment_service.selectOfferInterviewComment(offerInterviewCommentExample);
    }

    /**
     * 条件查询offerInterviewComment
     * @param offerInterviewCommentExample
     * @param pageable 是否需要分页
     * @return
     */
    public List<OfferInterviewComment> selectOfferInterviewComment(OfferInterviewCommentExample offerInterviewCommentExample, boolean pageable){
        if(! pageable){
            PageHelper.clearPage();
        }
        return offerInterviewComment_service.selectOfferInterviewComment(offerInterviewCommentExample);
    }

    /**
     * 保存offerInterviewComment
     * @return
     */
    public boolean saveOfferInterviewComment(OfferInterviewComment offerInterviewComment){
        int i = offerInterviewComment_service.saveOfferInterviewComment(offerInterviewComment);
        if(i == 0){
            return false;
        }
        return true;
    }

    /**
     * 保存offerInterviewComment
     * @return
     */
    public boolean updateOfferInterviewCommentNotNull(OfferInterviewComment offerInterviewComment){
        int i = offerInterviewComment_service.updateOfferInterviewCommentNotNull(offerInterviewComment);
        if(i == 0){
            return false;
        }
        return true;
    }

    /**
     * 保存offerInterviewComment
     * @return
     */
    public boolean updateOfferInterviewComment(OfferInterviewComment offerInterviewComment){
        int i = offerInterviewComment_service.updateOfferInterviewComment(offerInterviewComment);
        if(i == 0){
            return false;
        }
        return true;
    }

    /**
     * 删除offerInterviewComment
     * @return
     */
    public boolean deleteOfferInterviewComment(int offerInterviewCommentId){
        int i = offerInterviewComment_service.deleteOfferInterviewComment(offerInterviewCommentId);
        if(i == 0){
            return false;
        }
        return true;
    }
}
